package eu.pago.chat.gui;

import java.awt.BorderLayout;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class BlockFriendFrame extends JFrame{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	List<String> friendsList;
	
	public BlockFriendFrame(List<String> friendsList){
		this.friendsList = friendsList;
		this.setLayout(new BorderLayout());
		add(selectBlockFriend(friendsList), BorderLayout.NORTH);
		add(createBlockButton(), BorderLayout.CENTER);
		
	}
	
	private JPanel selectBlockFriend(List<String> friendsList){
		JPanel friendsPanel = new JPanel();
		JLabel selectFriendLabel = new JLabel("Select Friend: ");
		friendsPanel.add(selectFriendLabel);
		JComboBox<String> friendsCombo = new JComboBox<String>();
		
		friendsPanel.add(selectFriendLabel);
		friendsPanel.add(friendsCombo);
		for (String friends : friendsList){
			friendsCombo.addItem(friends);
		}
		
		return friendsPanel;
	}
	
	public JPanel createBlockButton(){
		JPanel blockButtonPanel = new JPanel();
		JButton blockButton = new JButton("Block");
		blockButtonPanel.add(blockButton);
		return blockButtonPanel;
	}
}
